package demo.practice.leetcode_eveyday;

import java.util.Arrays;

public class P1736 {


    //int [] rp= new int[]{2,}

    public static void main(String[] args) {
        P1736 p1736 = new P1736();
        p1736.maximumTime("?0:15");
    }

    public String maximumTime(String time) {


        char[] chars = time.toCharArray();
        chars[0] = chars[0] == '?' ? (chars[1] != '?' && chars[1] > '3' ? '1' : '2') : chars[0];


        chars[1] = chars[1] == '?' ? (chars[0] == '2') ? '3' : '9' : chars[1];
        chars[3] = chars[3] == '?' ? '5' : chars[3];
        chars[4] = chars[4] == '?' ? '9' : chars[4];

        return new String(chars);
    }
}
